#ifndef __GS_SLICE_H__
#define __GS_SLICE_H__

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>

typedef struct SliceStruct {
  int length;
  int capacity;
  char data[];
} SliceStruct;

typedef char* Slice;

Slice SliceCreate(int capacity);
Slice SliceCreate2(const char* data, int length);
void SliceDestroy(void* slice);
void SliceEmpty(Slice slice);
int SliceIsEmpty(Slice slice);
int SliceLength(Slice slice);
int SliceCapacity(Slice slice);
Slice SliceResize(Slice slice, int capacity);
Slice SliceClone(const Slice slice);
void SliceCopy(Slice slice, const char* b, int length);
int SlicePrint(Slice slice, const char* format, ...);
int SliceCat(Slice slice, const char* str, int length);
int SliceCompare(const Slice a, const Slice b);
uint32_t SliceHash(const Slice slice);

#endif

